package com.xbongbong.pro.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.pro.enums.permission.enums.ProPermissionAliasEnum;
import lombok.Getter;

/**
 * 首页菜单
 * @author: wufeng
 * @date: 2019/1/8 10:10
 */
@Getter
public enum HomeMenuEnum {


    // 顶部中心菜单栏
    HOME("home", PaasConstant.TOP_CENTER_POSITION, "enum.homeMenu.name.home", AccessLinkEnum.HOME, ""),

    TEMPLATE_CENTER("templateCenter", PaasConstant.TOP_CENTER_POSITION, "enum.homeMenu.name.template_center", AccessLinkEnum.TEMPLATE_CENTER, ProPermissionAliasEnum.MODULE_CENTER.getAlias()),

    CHART_CENTER("chartCenter", PaasConstant.TOP_CENTER_POSITION, "enum.homeMenu.name.chart_center", AccessLinkEnum.CHART_CENTER, ProPermissionAliasEnum.CHART_CENTER.getAlias()),

    // 顶部右侧菜单栏,

    WORKFLOW("workFlow", PaasConstant.TOP_RIGHT_POSITION, "enum.homeMenu.name.workflow", AccessLinkEnum.WORKFLOW, ProPermissionAliasEnum.PROCESS.getAlias()),

    MESSAGE("message", PaasConstant.TOP_RIGHT_POSITION, "enum.homeMenu.name.message", AccessLinkEnum.MESSAGE_PUSH, ""),

    HELP("help", PaasConstant.TOP_RIGHT_POSITION, "enum.homeMenu.name.help", AccessLinkEnum.HELP, ""),

    CONTROL_CENTER("controlCenter", PaasConstant.TOP_RIGHT_POSITION, "enum.homeMenu.name.control_center", AccessLinkEnum.CONTROL_CENTER, ProPermissionAliasEnum.MANAGE_CENTER.getAlias()),

    // 首页左侧栏
    LEFT_HOME("leftHome", PaasConstant.LEFT_POSITION, "enum.homeMenu.name.left_home", AccessLinkEnum.HOME, ""),

    COMMON_FORM("commonForm", PaasConstant.LEFT_POSITION, "enum.homeMenu.name.common_form", AccessLinkEnum.COMMON_FORM, "")
    ;

    /**
     * 英文
     */
    private String alias;

    /**
     * 界面上的位置
     */
    private String position;

    /**
     * 名字
     */
    private String name;

    private AccessLinkEnum accessLinkEnum;

    private String permissionAlias;

    HomeMenuEnum(String alias, String position, String name, AccessLinkEnum accessLinkEnum, String permissionAlias){
        this.alias = alias;
        this.position = position;
        this.name = name;
        this.accessLinkEnum = accessLinkEnum;
        this.permissionAlias = permissionAlias;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }

    public String getI18nName() {
        return name;
    }
}
